<?php
class AreaModel extends model
{
	static $_instance = null;

	static function getInstance ()
	{
		if (is_null(self::$_instance)) {
			self::$_instance = new self();
		}
		return self::$_instance;
	}
	
	// 增加
	function AreaAdd($p)
	{
		return $this->sql("insert into crm_area (`name`,`parent`)values('[name]','[id]')",$p)->i();
	}

	// 修改
	function AreaUpd($p)
	{
		return $this->sql("update crm_area set `name`='[name]' where `id`='[id]'",$p)->u();
	}
	
	// 删除
	function AreaDel($p)
	{
		return $this->sql("delete from crm_area where `id`='[id]'",$p)->u();
	}
}